Learn R Programming

BMS (version 0.3.4)

[.bma: Extract Parts of a topmod Object

Description

returns a bma (or topmod) object whose

Usage

"["(x, i, ...)
"["(x, i, ...)

Arguments

x
an object of class 'bma' or of class topmod
i
index of the best models to be retained
...
arguments such as 'drop' will not have an effect

Value

If x is a topmod object (see topmod), then x[i] returns a topmod object that only retains the models specified by iif x is an object of class bma (see bms), x[i] returns a bma object whose topmod object (i.e. x$topmod has been adjusted accordingly)

Details

Both functions are equivalent: they serve to select a subset of the best models in a bma object.

See Also

[ for the default method, bms for crating bma objects

Check http://bms.zeugner.eu for additional help.

Examples

Run this code
#sample some BMA
 data(datafls)
 mm=bms(datafls[,1:11])
 
#plotConv for all models 
 plotConv(mm)

#plotConv for the best 20 models 
 plotConv(mm[1:20])

#model binary for the second best model 
topmodels.bma(mm[2])

#similar:
as.vector(mm$topmod[2]$bool_binary())

#exactly the same
as.vector(mm[2]$topmod$bool_binary())


#print stats for second best model
print(mm$topmod[2])




Run the code above in your browser using DataLab